<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<style>
    .psmsg{color: #aaa;text-align: center;}

    #commentForm .main-container{padding-bottom: 50px!important;}
    .main-container{padding-top: 10px!important;}
    .add-tag{margin: 5px 0}
    .mainBox{bottom: 0!important;}
    .xuanmsg{color: #aaa;margin: 9px 0 5px 11px;font-size: 12px}
    .page-title{border-bottom: 10px solid #ecf0f1;}
    .bottss{width: 100%;height: 30px;position: fixed;bottom: 0;}

</style>
<body id="optPage">
<form class="layui-form layui-form-pane" id="commentForm">
    <div class="page-title">
        <div class="page-title-con"><span>跳过审核人(超管)</span><div class="move_title"></div><?php include "../public/sub.php";?></div>
    </div>
    <div class="main-container">
        <div class="block-generic">
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label"><text>*</text>跳过审核人</label>
                        <div class="layui-input-block">
                            <select id="taskid" name="taskid" lay-filter="taskid" >
                                <option value="">请选择</option>
                            </select>
                            <p class="error" id="taskid_error" style="margin: 0;"></p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">说明</label>
                        <div class="layui-input-block">
                            <input type="text" name="explain" id="explain" placeholder="请输入" clearable  autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item psmsg" style="padding-top: 30px">
                PS：跳过审核人，表示当前审核人被超管撤出审核组，不参与审核。
            </div>


        </div>
    </div>
</form>
<div class="bottss"></div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;
        facade.ajax({type: 'get', url: ask_flow_jumpshen_bill, data:{id:param_id}}).done(function(res){
            if (res.code === 2000) {

                var taskid_str = '<option value="">请选择</option>';
                var taskidArr = res.data.taskidArr;
                for (var key in taskidArr){
                    taskid_str += '<option value="'+taskidArr[key].id+'">'+taskidArr[key].name+'('+taskidArr[key].uid_name+')</option>';
                }
                $('#taskid').html(taskid_str);

                render_from();
            }
        });

        form.on('select(taskid)', function(data){
            if(data.value == ''){
                $('#taskid_error').show().text('请选择');
                $('#taskid_error').parent().find('input').addClass('select_error');
            }else{
                $('#taskid_error').hide();
                $('#taskid_error').parent().find('input').removeClass('select_error');
            }
        });


        form.on('submit(add)', function(data){
            var validRes = true;
            if(data.field.taskid == ''){
                $('#taskid_error').show().text('请选择');
                $('#taskid_error').parent().find('input').addClass('select_error');
                validRes = false;
            }else{
                $('#taskid_error').hide();
                $('#taskid_error').parent().find('input').removeClass('select_error');
            }
            if(!validRes){return false;}


            data.field.id = param_id;
            facade.ajax({url: ask_flow_jumpshen_bill, data:data.field}).done(function(res){
                if (res.code === 2000) {
                    facade.success('操作成功');
                    setTimeout(function () {
                        parent.window.location.reload();
                    },1500);
                }
            });

            return false;
        });
    });


</script>
</body>
</html>
